<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Trang left</title>
<script type="text/javascript" src="jquery.js"></script> 
<script type="text/javascript" src="jquery.corner.js"></script> 
<script> 
$(document).ready(function()
 { 
 $("#sptheohang").corner ("8px bottom");
 $("#sptheohang1").corner ("8px bottom");
 $("#sptheohang3").corner ("8px bottom");
 $("#sptheohang4").corner ("8px bottom");
 $("#sptheohang5").corner ("8px bottom");
  $("#sptheohang6").corner ("8px bottom");
}); 
</script>
<script>
function validForm_search(){
	if (document.search_form.gia_tu.selectedIndex=="0") {
			alert("Bạn chưa chọn giá từ");
			document.search_form.gia_tu.focus();
			return false;
		}
	if (document.search_form.gia_den.selectedIndex=="0") {
			alert("Bạn chưa chọn giá đến");
			document.search_form.gia_den.focus();
			return false;
		}
	if (document.search_form.gia_tu.selectedIndex > document.search_form.gia_den.selectedIndex) {
			alert("Giá đến không được nhỏ hơn giá từ");
			document.search_form.gia_den.focus();
			return false;
		}		
}
 
</script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="jquery.vticker.js"></script>
<script type="text/javascript">
$(function(){
$('.cuontrai').vTicker({
speed: 500,
pause: 3000,
animation: 'fade',
mousePause: false,
showItems: 3
});
}); 
</script>

</head>

<body>
<table width="200" border="0" cellspacing="0" cellpadding="0" id="banghanglaptop">
  <tr>
    <td id ="oleft">&nbsp;</td>
    <td align="center" id="ocenter">Laptop theo hãng</td>
    <td id="oright">&nbsp;</td>
  </tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0"id="sptheohang">
  <tr>
    <td style="padding-left:35px">
	<?php 
	include("kn.php"); 
	$lenh_hang = "select * from hanglaptop";
	$kq_hang = mysql_query($lenh_hang);
	
	while($row_hang = mysql_fetch_array($kq_hang))
	{
	?>
    <a href="index.php?idhang=<?php echo $row_hang[0]?>"><?php echo $row_hang[1];?></a>
	
    <br />
    <?php	
	}
	  ?>
      </td>
  </tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0" id="banghanglaptop">
  <tr>
    <td id ="oleft">&nbsp;</td>
    <td align="center" id="ocenter">Laptop theo giá</td>
    <td id="oright">&nbsp;</td>
  </tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0"id="sptheohang1">
  <tr>
    <td align="center">
    <form id="search_form" name="search_form" method="post" action="index.php?act=timkiemtheogia" onsubmit="return  validForm_search()">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td align="center"><select name="gia_tu" id="gia_tu" style="width:110px">
      <option value="0">-- Giá từ --</option>
      <?php
	  for($i = 500000;$i <= 20000000;$i+=500000)
	  {
		?>  
		   <option value='<?php echo $i;  ?>'<?php   if($_POST['gia_tu']==$i){?> selected="selected"<?php } ?>><?php  echo number_format($i,0,',','.');  ?></option>
       <?php
		  
	  }
	  
	  ?>
     
      </select></td>
    </tr>
    <tr>
      <td align="center"><label for="gia_den" ></label>
        <select name="gia_den" id="gia_den" style="width:110px">
         <option value="0">-- Giá đến --</option>
      <?php
	  for($i = 500000;$i <= 20000000;$i+=500000)
	  {
		?>  
		   <option value='<?php echo $i;  ?>'<?php   if($_POST['gia_den']==$i){?> selected="selected"<?php } ?>><?php  echo number_format($i,0,',','.');  ?></option>
       <?php
		  
	  }
	  
	  ?>
      </select></td>
    </tr>
    <tr>
      <td height="35" align="center"><input type="submit" name="timkiem" id="timkiem" value="Tìm " style=" padding-left:20px; padding-right:20px;border-radius:10px 10px 10px 10px;" /></td>
    </tr>
  </table>
</form>
    </td>
  </tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0" id="banghanglaptop">
  <tr>
    <td id ="oleft">&nbsp;</td>
    <td align="center" id="ocenter">Laptop mới</td>
    <td id="oright">&nbsp;</td>
  </tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0"id="sptheohang3">
  <tr>
    <td style="padding-left:15px">
      <?php 
	include("kn.php"); 
	$lenh_moi = "select malaptop,left(tenlaptop,15) as tenlaptop from laptop order by ngaynhap desc limit 0,6";
	$kq_moi = mysql_query($lenh_moi);
	while($row_moi = mysql_fetch_array($kq_moi))
	{
	?>
      <a href="index.php?idmoi=<?php echo $row_moi[0]?>"><?php echo $row_moi[1];?></a> 
      <img src="image/new.gif" width="30" height="16" /><br />
      <?php	
	}
	  ?>
    </span></td>
  </tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0" id="banghanglaptop">
  <tr>
    <td id ="oleft">&nbsp;</td>
    <td align="center" id="ocenter">Laptop bán chạy</td>
    <td id="oright">&nbsp;</td>
  </tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0"id="sptheohang4">
  <tr>
    <td align="center">
   <?php 
	include("kn.php"); 
	$lenh_bc = "select laptop.malaptop,left(tenlaptop,15)as tenlaptop,count(donhangchitiet.malaptop)as sl,hinh,concat(format(laptop.dongia,0),' VNĐ')as dongia
from laptop, donhangchitiet
where laptop.malaptop = donhangchitiet.malaptop 
group by tenlaptop
order by sl desc 
limit 0,3
";
	$kq_bc = mysql_query($lenh_bc);
	?>
    <div class="cuontrai" align="center">
    	<ul>
    <?php
	while($row_bc = mysql_fetch_array($kq_bc))
	{
			
	?>
    <li>
    <a href="index.php?idbc=<?php echo $row_bc[0]?>">
	<?php echo $row_bc[1];?></a>
	  <br />
      
      <img src="laptop/<?php echo $row_bc[3]?>" width="100" height="75" />
     
      <br />
        <font color="#FF0000"><?php echo $row_bc[4]?></font>
      <br /><strong></strong>
      </li>
    <?php	
	}
	  ?>
      	</ul>
      </div>
    </td>
  </tr>
</table>

<table width="200" border="0" cellspacing="0" cellpadding="0" id="banghanglaptop">
  <tr>
    <td id ="oleft">&nbsp;</td>
    <td align="center" id="ocenter">Thông tin giỏ hàng <img src="image/cart1.gif" width="23" height="23" /></td>
    <td id="oright">&nbsp;</td>
  </tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0"id="sptheohang5">
  <tr>
    <td align="center"><?php include("khunggiohang.php");   ?></td>
  </tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0" id="banghanglaptop">
  <tr>
    <td id ="oleft">&nbsp;</td>
    <td align="center" id="ocenter">Tỉ giá</td>
    <td id="oright">&nbsp;</td>
  </tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0"id="sptheohang6">
  <tr>
    <td align="center"><iframe src="http://tienich.vnpec.com/usd/usd-5.php" frameborder="0" height=155 scrolling="no" width="100%"></iframe></td>
  </tr>
</table>
</body>
</html>